package com.bamboowind.rabbitmq.topic.listener;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author cpw
 */
@Component
public class MessageListener {
    /**
     * 监视队列topic_queue，满足routingKey topic.*.id则进入该方法
     *
     * @param id
     */
    @RabbitListener(queues = "topic_queue")
    public void receive(String id) {
        System.out.println("已完成短信发送业务(rabbitmq topic 1)，id：" + id);
    }

    /**
     * 监视队列topic_queue2，满足routingKey topic.orders.*则进入该方法
     *
     * @param id
     */
    @RabbitListener(queues = "topic_queue2")
    public void receive2(String id) {
        System.out.println("已完成短信发送业务(rabbitmq topic 2)，id：" + id);
    }
}
